<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>The Earth Archive | Preserving Wonder, One Scale at a Time</title>
    <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lato:wght@300;400;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --deep-space: #2C3E50;
            --archival-khaki: #ECF0F1;
            --glacial-blue: #3498DB;
            --crisis-orange: #E74C3C;
            --success-green: #2ECC71;
            --transition: all 0.4s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Lato', sans-serif;
            line-height: 1.7;
            color: var(--deep-space);
            background-color: var(--archival-khaki);
            overflow-x: hidden;
        }

        h1, h2, h3, h4 {
            font-family: 'Playfair Display', serif;
            font-weight: 600;
            letter-spacing: -0.02em;
            line-height: 1.3;
        }

        .container {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* Header Styles */
        header {
            position: fixed;
            top: 0;
            width: 100%;
            background-color: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            z-index: 1000;
            padding: 20px 0;
            transition: var(--transition);
            border-bottom: 1px solid rgba(44, 62, 80, 0.1);
        }

        header.scrolled {
            padding: 15px 0;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-family: 'Playfair Display', serif;
            font-size: 24px;
            font-weight: 700;
            color: var(--deep-space);
            text-decoration: none;
        }

        .logo span {
            color: var(--glacial-blue);
        }

        nav ul {
            display: flex;
            list-style: none;
            align-items: center;
        }

        nav li {
            margin-left: 30px;
        }

        nav a {
            text-decoration: none;
            color: var(--deep-space);
            font-weight: 400;
            font-size: 16px;
            transition: var(--transition);
            position: relative;
        }

        nav a:hover {
            color: var(--glacial-blue);
        }

        nav a:after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 0;
            height: 2px;
            background-color: var(--glacial-blue);
            transition: var(--transition);
        }

        nav a:hover:after {
            width: 100%;
        }

        .cart-icon {
            position: relative;
            font-size: 1.2rem;
            cursor: pointer;
        }

        .cart-count {
            position: absolute;
            top: -10px;
            right: -10px;
            background-color: var(--crisis-orange);
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: bold;
        }

        .cta-button {
            background-color: var(--glacial-blue);
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            display: inline-block;
        }

        .cta-button:hover {
            background-color: #2980b9;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
        }

        .secondary-button {
            background-color: transparent;
            color: var(--deep-space);
            border: 2px solid var(--deep-space);
            padding: 10px 25px;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            display: inline-block;
        }

        .secondary-button:hover {
            background-color: var(--deep-space);
            color: white;
        }

        /* Hero Section */
        .hero {
            height: 100vh;
            background: linear-gradient(rgba(44, 62, 80, 0.7), rgba(44, 62, 80, 0.9)), url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
            background-size: cover;
            background-position: center;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: white;
            position: relative;
        }

        .hero-content {
            max-width: 800px;
            padding: 0 20px;
            opacity: 0;
            transform: translateY(30px);
            animation: fadeUp 1s ease forwards 0.5s;
        }

        .hero h1 {
            font-size: 3.5rem;
            margin-bottom: 20px;
            font-weight: 700;
        }

        .hero p {
            font-size: 1.2rem;
            margin-bottom: 30px;
            font-weight: 300;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }

        .hero-buttons {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 30px;
        }

        .hero-secondary-button {
            background-color: transparent;
            color: white;
            border: 2px solid white;
            padding: 10px 25px;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            display: inline-block;
        }

        .hero-secondary-button:hover {
            background-color: white;
            color: var(--deep-space);
        }

        /* Data Banner */
        .data-banner {
            background-color: var(--deep-space);
            color: white;
            padding: 60px 0;
            text-align: center;
        }

        .data-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 30px;
            margin-top: 40px;
        }

        .data-item {
            padding: 20px;
        }

        .data-number {
            font-size: 3rem;
            font-weight: 700;
            margin-bottom: 10px;
            color: var(--glacial-blue);
        }

        .data-label {
            font-size: 1.1rem;
            color: #bdc3c7;
        }

        /* Mission Section */
        .mission {
            padding: 100px 0;
            background-color: white;
        }

        .section-header {
            text-align: center;
            margin-bottom: 60px;
        }

        .section-header h2 {
            font-size: 2.5rem;
            margin-bottom: 15px;
        }

        .section-header p {
            max-width: 700px;
            margin: 0 auto;
            color: #7f8c8d;
        }

        .mission-content {
            display: flex;
            align-items: center;
            gap: 50px;
        }

        .mission-text {
            flex: 1;
        }

        .mission-text h3 {
            font-size: 1.8rem;
            margin-bottom: 20px;
        }

        .mission-text p {
            margin-bottom: 20px;
        }

        .mission-image {
            flex: 1;
            border-radius: 5px;
            overflow: hidden;
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        }

        .mission-image img {
            width: 100%;
            height: auto;
            display: block;
            transition: var(--transition);
        }

        .mission-image:hover img {
            transform: scale(1.05);
        }

        /* Archives Section */
        .archives {
            padding: 100px 0;
            background-color: var(--archival-khaki);
        }

        .archive-controls {
            display: flex;
            justify-content: space-between;
            margin-bottom: 40px;
            flex-wrap: wrap;
            gap: 20px;
        }

        .search-box {
            flex: 1;
            min-width: 300px;
            position: relative;
        }

        .search-box input {
            width: 100%;
            padding: 12px 20px 12px 45px;
            border: 1px solid #ddd;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-size: 16px;
            transition: var(--transition);
        }

        .search-box input:focus {
            border-color: var(--glacial-blue);
            outline: none;
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #7f8c8d;
        }

        .filter-options {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
        }

        .filter-btn {
            background-color: white;
            border: 1px solid #ddd;
            padding: 10px 20px;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
        }

        .filter-btn.active {
            background-color: var(--glacial-blue);
            color: white;
            border-color: var(--glacial-blue);
        }

        .filter-btn:hover:not(.active) {
            background-color: #f8f9fa;
        }

        .archive-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 30px;
        }

        .archive-card {
            background-color: white;
            border-radius: 5px;
            overflow: hidden;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
            transition: var(--transition);
            opacity: 0;
            transform: translateY(30px);
            position: relative;
        }

        .archive-card.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .archive-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        }

        .archive-image {
            height: 250px;
            overflow: hidden;
            position: relative;
        }

        .archive-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--transition);
        }

        .archive-card:hover .archive-image img {
            transform: scale(1.1);
        }

        .archive-price {
            position: absolute;
            top: 15px;
            right: 15px;
            background-color: rgba(44, 62, 80, 0.9);
            color: white;
            padding: 5px 10px;
            border-radius: 3px;
            font-weight: 700;
            font-size: 1.1rem;
        }

        .archive-content {
            padding: 25px;
        }

        .archive-id {
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
            color: var(--glacial-blue);
            margin-bottom: 10px;
            display: block;
        }

        .archive-title {
            font-size: 1.4rem;
            margin-bottom: 10px;
        }

        .archive-status {
            display: inline-block;
            padding: 5px 10px;
            background-color: rgba(231, 76, 60, 0.1);
            color: var(--crisis-orange);
            border-radius: 3px;
            font-size: 0.8rem;
            font-weight: 700;
            margin-bottom: 15px;
        }

        .archive-description {
            margin-bottom: 20px;
            color: #7f8c8d;
        }

        .archive-actions {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
        }

        .add-to-cart {
            background-color: var(--glacial-blue);
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .add-to-cart:hover {
            background-color: #2980b9;
        }

        .add-to-cart.added {
            background-color: var(--success-green);
        }

        .view-details {
            background-color: transparent;
            color: var(--deep-space);
            border: 1px solid var(--deep-space);
            padding: 10px 15px;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
        }

        .view-details:hover {
            background-color: var(--deep-space);
            color: white;
        }

        .archive-specs {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid #eee;
        }

        .spec {
            text-align: center;
        }

        .spec-value {
            font-weight: 700;
            font-size: 1.1rem;
        }

        .spec-label {
            font-size: 0.8rem;
            color: #7f8c8d;
            margin-top: 5px;
        }

        /* Membership Section */
        .membership {
            padding: 100px 0;
            background-color: white;
        }

        .membership-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            margin-top: 50px;
        }

        .membership-card {
            background-color: var(--archival-khaki);
            border-radius: 5px;
            padding: 40px 30px;
            text-align: center;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }

        .membership-card:before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background-color: var(--glacial-blue);
        }

        .membership-card.featured:before {
            height: 8px;
            background: linear-gradient(90deg, var(--glacial-blue), var(--success-green));
        }

        .membership-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        }

        .membership-icon {
            font-size: 3rem;
            color: var(--glacial-blue);
            margin-bottom: 20px;
        }

        .membership-title {
            font-size: 1.5rem;
            margin-bottom: 15px;
        }

        .membership-price {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 20px;
            color: var(--deep-space);
        }

        .membership-price span {
            font-size: 1rem;
            color: #7f8c8d;
        }

        .membership-features {
            list-style: none;
            margin-bottom: 30px;
            text-align: left;
        }

        .membership-features li {
            margin-bottom: 10px;
            display: flex;
            align-items: flex-start;
        }

        .membership-features li:before {
            content: '✓';
            color: var(--success-green);
            margin-right: 10px;
            font-weight: bold;
        }

        .membership-badge {
            position: absolute;
            top: 20px;
            right: -30px;
            background-color: var(--success-green);
            color: white;
            padding: 5px 30px;
            transform: rotate(45deg);
            font-size: 0.8rem;
            font-weight: 700;
        }

        /* Process Section */
        .process {
            padding: 100px 0;
            background-color: var(--archival-khaki);
        }

        .process-steps {
            display: flex;
            justify-content: space-between;
            margin-top: 50px;
            position: relative;
        }

        .process-steps:before {
            content: '';
            position: absolute;
            top: 60px;
            left: 10%;
            right: 10%;
            height: 2px;
            background-color: #ddd;
            z-index: 1;
        }

        .process-step {
            text-align: center;
            position: relative;
            z-index: 2;
            flex: 1;
            padding: 0 20px;
            opacity: 0;
            transform: translateY(30px);
        }

        .process-step.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .step-icon {
            width: 120px;
            height: 120px;
            background-color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 25px;
            font-size: 40px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            border: 2px solid #eee;
        }

        .step-title {
            font-size: 1.3rem;
            margin-bottom: 15px;
        }

        .step-description {
            color: #7f8c8d;
            margin-bottom: 15px;
        }

        .tech-specs {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 20px;
        }

        .tech-spec {
            background-color: white;
            padding: 8px 12px;
            border-radius: 3px;
            font-size: 0.8rem;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        /* CTA Section */
        .cta-section {
            padding: 100px 0;
            background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(44, 62, 80, 0.9)), url('https://images.unsplash.com/photo-1464822759849-e0e1008718a9?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
            background-size: cover;
            background-position: center;
            color: white;
            text-align: center;
        }

        .cta-section h2 {
            font-size: 2.5rem;
            margin-bottom: 20px;
        }

        .cta-section p {
            max-width: 700px;
            margin: 0 auto 30px;
            font-size: 1.1rem;
        }

        .email-form {
            max-width: 500px;
            margin: 0 auto;
            display: flex;
        }

        .email-input {
            flex: 1;
            padding: 15px 20px;
            border: none;
            border-radius: 2px 0 0 2px;
            font-family: 'Lato', sans-serif;
            font-size: 16px;
        }

        .email-submit {
            background-color: var(--glacial-blue);
            color: white;
            border: none;
            padding: 0 25px;
            border-radius: 0 2px 2px 0;
            font-family: 'Lato', sans-serif;
            font-weight: 700;
            cursor: pointer;
            transition: var(--transition);
        }

        .email-submit:hover {
            background-color: #2980b9;
        }

        /* Shopping Cart Sidebar */
        .cart-sidebar {
            position: fixed;
            top: 0;
            right: -400px;
            width: 400px;
            height: 100vh;
            background-color: white;
            box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
            z-index: 2000;
            transition: var(--transition);
            display: flex;
            flex-direction: column;
        }

        .cart-sidebar.active {
            right: 0;
        }

        .cart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            border-bottom: 1px solid #eee;
        }

        .cart-header h3 {
            font-size: 1.5rem;
        }

        .close-cart {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--deep-space);
        }

        .cart-items {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .cart-item {
            display: flex;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #eee;
        }

        .cart-item-image {
            width: 80px;
            height: 80px;
            border-radius: 5px;
            overflow: hidden;
            margin-right: 15px;
        }

        .cart-item-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cart-item-details {
            flex: 1;
        }

        .cart-item-title {
            font-weight: 700;
            margin-bottom: 5px;
        }

        .cart-item-id {
            font-family: 'Courier New', monospace;
            font-size: 0.8rem;
            color: var(--glacial-blue);
            margin-bottom: 5px;
        }

        .cart-item-price {
            font-weight: 700;
            color: var(--deep-space);
        }

        .cart-item-quantity {
            display: flex;
            align-items: center;
            margin-top: 10px;
        }

        .quantity-btn {
            width: 30px;
            height: 30px;
            background-color: var(--archival-khaki);
            border: none;
            border-radius: 3px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .quantity-input {
            width: 40px;
            height: 30px;
            text-align: center;
            border: 1px solid #eee;
            margin: 0 5px;
            border-radius: 3px;
        }

        .remove-item {
            background: none;
            border: none;
            color: var(--crisis-orange);
            cursor: pointer;
            margin-left: 10px;
            font-size: 0.9rem;
        }

        .cart-footer {
            padding: 20px;
            border-top: 1px solid #eee;
        }

        .cart-total {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
            font-weight: 700;
            font-size: 1.2rem;
        }

        .checkout-btn {
            width: 100%;
            background-color: var(--glacial-blue);
            color: white;
            border: none;
            padding: 15px;
            border-radius: 2px;
            font-family: 'Lato', sans-serif;
            font-weight: 700;
            font-size: 16px;
            cursor: pointer;
            transition: var(--transition);
        }

        .checkout-btn:hover {
            background-color: #2980b9;
        }

        .empty-cart {
            text-align: center;
            padding: 40px 20px;
            color: #7f8c8d;
        }

        .empty-cart i {
            font-size: 3rem;
            margin-bottom: 15px;
            color: #ddd;
        }

        /* Product Detail Modal */
        .product-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            z-index: 3000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
        }

        .product-modal.active {
            opacity: 1;
            visibility: visible;
        }

        .modal-content {
            background-color: white;
            width: 90%;
            max-width: 1000px;
            max-height: 90vh;
            border-radius: 5px;
            overflow: hidden;
            display: flex;
            opacity: 0;
            transform: translateY(50px);
            transition: var(--transition);
        }

        .product-modal.active .modal-content {
            opacity: 1;
            transform: translateY(0);
            transition-delay: 0.2s;
        }

        .modal-image {
            flex: 1;
            background-color: var(--archival-khaki);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 30px;
        }

        .modal-image img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        .modal-details {
            flex: 1;
            padding: 30px;
            overflow-y: auto;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 20px;
        }

        .modal-title {
            font-size: 1.8rem;
            margin-bottom: 5px;
        }

        .modal-id {
            font-family: 'Courier New', monospace;
            color: var(--glacial-blue);
            margin-bottom: 10px;
            display: block;
        }

        .modal-price {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--deep-space);
        }

        .modal-description {
            margin-bottom: 20px;
            line-height: 1.6;
        }

        .modal-tabs {
            display: flex;
            border-bottom: 1px solid #eee;
            margin-bottom: 20px;
        }

        .modal-tab {
            padding: 10px 20px;
            background: none;
            border: none;
            font-family: 'Lato', sans-serif;
            font-size: 16px;
            cursor: pointer;
            transition: var(--transition);
            border-bottom: 2px solid transparent;
        }

        .modal-tab.active {
            border-bottom-color: var(--glacial-blue);
            color: var(--glacial-blue);
            font-weight: 700;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .modal-specs {
            margin-bottom: 30px;
        }

        .specs-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-top: 15px;
        }

        .spec-item {
            background-color: var(--archival-khaki);
            padding: 15px;
            border-radius: 5px;
        }

        .spec-label {
            font-size: 0.8rem;
            color: #7f8c8d;
            margin-bottom: 5px;
        }

        .spec-value {
            font-weight: 700;
            font-size: 1rem;
        }

        .cultural-info {
            line-height: 1.6;
        }

        .cultural-info h4 {
            margin: 20px 0 10px;
            font-size: 1.2rem;
        }

        .cultural-info p {
            margin-bottom: 15px;
        }

        .modal-actions {
            display: flex;
            gap: 15px;
            margin-top: 30px;
        }

        .close-modal {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: none;
            font-size: 1.5rem;
            color: white;
            cursor: pointer;
            z-index: 10;
        }

        /* Footer */
        footer {
            background-color: var(--deep-space);
            color: white;
            padding: 60px 0 30px;
        }

        .footer-content {
            display: flex;
            justify-content: space-between;
            margin-bottom: 40px;
        }

        .footer-logo {
            font-family: 'Playfair Display', serif;
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 15px;
        }

        .footer-logo span {
            color: var(--glacial-blue);
        }

        .footer-description {
            max-width: 300px;
            color: #bdc3c7;
            line-height: 1.6;
        }

        .footer-links {
            display: flex;
            gap: 50px;
        }

        .footer-column h4 {
            margin-bottom: 20px;
            font-size: 1.1rem;
        }

        .footer-column ul {
            list-style: none;
        }

        .footer-column li {
            margin-bottom: 10px;
        }

        .footer-column a {
            color: #bdc3c7;
            text-decoration: none;
            transition: var(--transition);
        }

        .footer-column a:hover {
            color: white;
        }

        .footer-bottom {
            text-align: center;
            padding-top: 30px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: #bdc3c7;
            font-size: 0.9rem;
        }

        /* Animations */
        @keyframes fadeUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Overlay for modals */
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1999;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
        }

        .overlay.active {
            opacity: 1;
            visibility: visible;
        }

        /* Responsive Styles */
        @media (max-width: 992px) {
            .mission-content {
                flex-direction: column;
            }
            
            .process-steps {
                flex-direction: column;
                gap: 50px;
            }
            
            .process-steps:before {
                display: none;
            }
            
            .footer-content {
                flex-direction: column;
                gap: 40px;
            }
            
            .footer-links {
                gap: 30px;
            }

            .modal-content {
                flex-direction: column;
                max-height: 95vh;
            }

            .modal-image {
                max-height: 300px;
            }

            .cart-sidebar {
                width: 100%;
                right: -100%;
            }

            .archive-controls {
                flex-direction: column;
            }

            .data-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 768px) {
            .hero h1 {
                font-size: 2.5rem;
            }
            
            .archive-grid {
                grid-template-columns: 1fr;
            }
            
            .hero-buttons {
                flex-direction: column;
                align-items: center;
                gap: 15px;
            }
            
            .email-form {
                flex-direction: column;
                gap: 10px;
            }
            
            .email-input, .email-submit {
                width: 100%;
                border-radius: 2px;
            }
            
            nav ul {
                display: none;
            }
            
            .mobile-menu-btn {
                display: block;
            }

            .archive-actions {
                flex-direction: column;
                gap: 10px;
            }

            .specs-grid {
                grid-template-columns: 1fr;
            }

            .modal-actions {
                flex-direction: column;
            }

            .data-grid {
                grid-template-columns: 1fr;
            }

            .membership-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 576px) {
            .section-header h2 {
                font-size: 2rem;
            }
            
            .footer-links {
                flex-direction: column;
                gap: 30px;
            }
        }
    </style>
</head>
<body>
    <!-- Header -->
    <header id="header">
        <div class="container">
            <div class="header-content">
                <a href="#" class="logo">The Earth <span>Archive</span></a>
                <nav>
                    <ul>
                        <li><a href="#mission">Our Mission</a></li>
                        <li><a href="#archives">The Archives</a></li>
                        <li><a href="#membership">Membership</a></li>
                        <li><a href="#" class="cart-icon" id="cartIcon">
                            <i class="fas fa-shopping-cart"></i>
                            <span class="cart-count">0</span>
                        </a></li>
                        <li><a href="#" class="cta-button">Join Waitlist</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>

    <!-- Hero Section -->
    <section class="hero">
        <div class="hero-content">
            <h1>Preserving Wonder, One Scale at a Time</h1>
            <p>We combat the erosion of time by creating permanent, scale archives of Earth's vanishing wonders.</p>
            <div class="hero-buttons">
                <a href="#archives" class="cta-button">Explore the Vault</a>
                <a href="#membership" class="hero-secondary-button">Become a Member</a>
            </div>
        </div>
    </section>

    <!-- Data Banner -->
    <section class="data-banner">
        <div class="container">
            <h2>Our Planet's Precious Heritage Is Disappearing</h2>
            <div class="data-grid">
                <div class="data-item">
                    <div class="data-number">30%</div>
                    <div class="data-label">of glaciers lost since 2000</div>
                </div>
                <div class="data-item">
                    <div class="data-number">50%</div>
                    <div class="data-label">coral reefs lost in 30 years</div>
                </div>
                <div class="data-item">
                    <div class="data-number">68%</div>
                    <div class="data-label">wildlife population decline since 1970</div>
                </div>
                <div class="data-item">
                    <div class="data-number">1M</div>
                    <div class="data-label">species at risk of extinction</div>
                </div>
            </div>
        </div>
    </section>

    <!-- Mission Section -->
    <section class="mission" id="mission">
        <div class="container">
            <div class="section-header">
                <h2>Our Mission</h2>
                <p>We are a collective of scientists, artists, and engineers dedicated to preserving Earth's most vulnerable natural wonders.</p>
            </div>
            <div class="mission-content">
                <div class="mission-text">
                    <h3>From Landscape to Archive</h3>
                    <p>It began with a geologist's realization of glacial melt, which led to the formation of our collective. We are now on a mission to create a permanent backup of Earth's beauty.</p>
                    <p>Each archive is a 1:1 scale replica, created using advanced 3D scanning and modeling techniques. We capture not just the form, but the essence of these vanishing landscapes.</p>
                    <a href="#archives" class="cta-button">View Archives</a>
                </div>
                <div class="mission-image">
                    <img src="https://images.unsplash.com/photo-1544551763-46a013bb70d5?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80" alt="Glacier landscape">
                </div>
            </div>
        </div>
    </section>

    <!-- Archives Section -->
    <section class="archives" id="archives">
        <div class="container">
            <div class="section-header">
                <h2>Featured from the Vault</h2>
                <p>Explore our collection of preserved natural wonders, each with its own unique story and scientific data.</p>
            </div>
            <div class="archive-controls">
                <div class="search-box">
                    <i class="fas fa-search search-icon"></i>
                    <input type="text" id="archiveSearch" placeholder="Search archives by name, location, or ID...">
                </div>
                <div class="filter-options">
                    <button class="filter-btn active" data-filter="all">All</button>
                    <button class="filter-btn" data-filter="glacier">Glaciers</button>
                    <button class="filter-btn" data-filter="mountain">Mountains</button>
                    <button class="filter-btn" data-filter="volcano">Volcanoes</button>
                    <button class="filter-btn" data-filter="ocean">Oceans</button>
                </div>
            </div>
            <div class="archive-grid" id="archiveGrid">
                <!-- Archive cards will be populated by JavaScript -->
            </div>
        </div>
    </section>

    <!-- Membership Section -->
    <section class="membership" id="membership">
        <div class="container">
            <div class="section-header">
                <h2>Join Our Archive Guardians</h2>
                <p>Become part of our mission and help shape the future of Earth preservation</p>
            </div>
            <div class="membership-grid">
                <div class="membership-card">
                    <div class="membership-icon">
                        <i class="fas fa-seedling"></i>
                    </div>
                    <h3 class="membership-title">Explorer</h3>
                    <div class="membership-price">Free<span>/forever</span></div>
                    <ul class="membership-features">
                        <li>Access to basic archive information</li>
                        <li>Monthly newsletter</li>
                        <li>Early access to new releases</li>
                        <li>Submit location suggestions</li>
                    </ul>
                    <a href="#" class="cta-button">Join Now</a>
                </div>
                <div class="membership-card featured">
                    <div class="membership-badge">MOST POPULAR</div>
                    <div class="membership-icon">
                        <i class="fas fa-mountain"></i>
                    </div>
                    <h3 class="membership-title">Guardian</h3>
                    <div class="membership-price">$9.99<span>/month</span></div>
                    <ul class="membership-features">
                        <li>All Explorer benefits</li>
                        <li>10% discount on all archives</li>
                        <li>Exclusive behind-the-scenes content</li>
                        <li>Vote on next archive locations</li>
                        <li>Submit your own landscape photos</li>
                        <li>Priority customer support</li>
                    </ul>
                    <a href="#" class="cta-button">Become a Guardian</a>
                </div>
                <div class="membership-card">
                    <div class="membership-icon">
                        <i class="fas fa-crown"></i>
                    </div>
                    <h3 class="membership-title">Patron</h3>
                    <div class="membership-price">$29.99<span>/month</span></div>
                    <ul class="membership-features">
                        <li>All Guardian benefits</li>
                        <li>20% discount on all archives</li>
                        <li>Limited edition archives</li>
                        <li>Join our product development team</li>
                        <li>Exclusive virtual events with our team</li>
                        <li>Recognition on our website</li>
                        <li>Annual custom archive</li>
                    </ul>
                    <a href="#" class="cta-button">Become a Patron</a>
                </div>
            </div>
        </div>
    </section>

    <!-- Process Section -->
    <section class="process" id="process">
        <div class="container">
            <div class="section-header">
                <h2>The Archival Process</h2>
                <p>Our proprietary workflow ensures scientific accuracy and artistic excellence in every archive we create.</p>
            </div>
            <div class="process-steps">
                <div class="process-step">
                    <div class="step-icon">🛰️</div>
                    <h3 class="step-title">Data Capture</h3>
                    <p class="step-description">Satellite & Scan Data collection from multiple sources</p>
                    <div class="tech-specs">
                        <span class="tech-spec">Accuracy: ±5cm</span>
                        <span class="tech-spec">Resolution: 4K</span>
                    </div>
                </div>
                <div class="process-step">
                    <div class="step-icon">💻</div>
                    <h3 class="step-title">Digital Reconstruction</h3>
                    <p class="step-description">Precision 3D Modeling based on collected data</p>
                    <div class="tech-specs">
                        <span class="tech-spec">Polygons: 2M+</span>
                        <span class="tech-spec">Textures: 8K</span>
                    </div>
                </div>
                <div class="process-step">
                    <div class="step-icon">🔬</div>
                    <h3 class="step-title">Physical Archival</h3>
                    <p class="step-description">Artisanal Craftsmanship & Material Science application</p>
                    <div class="tech-specs">
                        <span class="tech-spec">Materials: 5+</span>
                        <span class="tech-spec">Layers: 120+</span>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- CTA Section -->
    <section class="cta-section">
        <div class="container">
            <h2>Join the Mission</h2>
            <p>Be the first to access new archives and support our work in preserving Earth's wonders for future generations.</p>
            <form class="email-form">
                <input type="email" class="email-input" placeholder="Enter your email address" required>
                <button type="submit" class="email-submit">Join Waitlist</button>
            </form>
        </div>
    </section>

    <!-- Footer -->
    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-info">
                    <div class="footer-logo">The Earth <span>Archive</span></div>
                    <p class="footer-description">A collective effort to preserve our planet's legacy through scientific archiving of its most precious landscapes.</p>
                </div>
                <div class="footer-links">
                    <div class="footer-column">
                        <h4>Explore</h4>
                        <ul>
                            <li><a href="#mission">Our Mission</a></li>
                            <li><a href="#archives">The Archives</a></li>
                            <li><a href="#membership">Membership</a></li>
                            <li><a href="#process">Our Process</a></li>
                        </ul>
                    </div>
                    <div class="footer-column">
                        <h4>Connect</h4>
                        <ul>
                            <li><a href="#">Contact Us</a></li>
                            <li><a href="#">Press Kit</a></li>
                            <li><a href="#">Careers</a></li>
                            <li><a href="#">Partnerships</a></li>
                        </ul>
                    </div>
                    <div class="footer-column">
                        <h4>Legal</h4>
                        <ul>
                            <li><a href="#">Privacy Policy</a></li>
                            <li><a href="#">Terms of Service</a></li>
                            <li><a href="#">Cookie Policy</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <p>&copy; 2023 The Earth Archive. All rights reserved. A Collective Effort to Preserve Our Planet's Legacy.</p>
            </div>
        </div>
    </footer>

    <!-- Shopping Cart Sidebar -->
    <div class="cart-sidebar" id="cartSidebar">
        <div class="cart-header">
            <h3>Your Archive Collection</h3>
            <button class="close-cart" id="closeCart">
                <i class="fas fa-times"></i>
            </button>
        </div>
        <div class="cart-items" id="cartItems">
            <!-- Cart items will be populated by JavaScript -->
        </div>
        <div class="cart-footer">
            <div class="cart-total">
                <span>Total:</span>
                <span id="cartTotal">$0.00</span>
            </div>
            <button class="checkout-btn" id="checkoutBtn">Proceed to Checkout</button>
        </div>
    </div>

    <!-- Product Detail Modal -->
    <div class="product-modal" id="productModal">
        <button class="close-modal" id="closeModal">
            <i class="fas fa-times"></i>
        </button>
        <div class="modal-content">
            <div class="modal-image">
                <img id="modalImage" src="" alt="">
            </div>
            <div class="modal-details">
                <div class="modal-header">
                    <div>
                        <h2 class="modal-title" id="modalTitle"></h2>
                        <span class="modal-id" id="modalId"></span>
                        <div class="modal-price" id="modalPrice"></div>
                    </div>
                </div>
                <div class="modal-tabs">
                    <button class="modal-tab active" data-tab="details">Details</button>
                    <button class="modal-tab" data-tab="specs">Specifications</button>
                    <button class="modal-tab" data-tab="cultural">Cultural Context</button>
                </div>
                <div class="tab-content active" id="detailsTab">
                    <p class="modal-description" id="modalDescription"></p>
                </div>
                <div class="tab-content" id="specsTab">
                    <div class="modal-specs">
                        <div class="specs-grid" id="modalSpecs">
                            <!-- Specs will be populated by JavaScript -->
                        </div>
                    </div>
                </div>
                <div class="tab-content" id="culturalTab">
                    <div class="cultural-info" id="culturalInfo">
                        <!-- Cultural info will be populated by JavaScript -->
                    </div>
                </div>
                <div class="modal-actions">
                    <button class="cta-button" id="modalAddToCart">
                        <i class="fas fa-shopping-cart"></i> Add to Collection
                    </button>
                    <button class="secondary-button" id="closeModalBtn">Close</button>
                </div>
            </div>
        </div>
    </div>

    <!-- Overlay for modals -->
    <div class="overlay" id="overlay"></div>

    <script>
        // Product data with cultural information
        const products = [
            {
                id: "GLC-001",
                title: "Jökulsárlón Glacier",
                category: "glacier",
                status: "Rapidly Receding",
                price: 249,
                image: "https://images.unsplash.com/photo-1551524164-6ca88f6d6ba3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
                description: "Located in Iceland, this glacier is retreating at an alarming rate due to climate change. Our archive captures its 2023 state with precise 1:1500 scaling. Each model includes integrated LED lighting to simulate the glacial blue ice effect.",
                specs: {
                    scale: "1:1500",
                    latitude: "64.1°N",
                    longitude: "16.2°W",
                    dimensions: "15 × 12 × 8 cm",
                    materials: "Bio-resin, Mineral Pigments",
                    lighting: "Integrated LED (Cool White)",
                    weight: "450g"
                },
                cultural: `
                    <h4>Cultural Significance</h4>
                    <p>Jökulsárlón, meaning 'glacial river lagoon', holds deep significance in Icelandic culture. It's featured prominently in Norse sagas and is considered one of Iceland's natural crown jewels. The lagoon formed only in the mid-1930s as the Breiðamerkurjökull glacier started retreating, making it a powerful visual representation of climate change.</p>
                    
                    <h4>Local Traditions</h4>
                    <p>Local folklore tells of hidden people (Huldufólk) living in the ice formations. Fishermen have long considered the lagoon's icebergs as bringers of good fortune when they wash ashore on the nearby Diamond Beach.</p>
                    
                    <h4>Modern Importance</h4>
                    <p>Today, Jökulsárlón serves as a critical research site for glaciologists studying climate change impacts. It has also become an iconic location for filmmakers, featuring in movies like James Bond's 'Die Another Day' and 'A View to a Kill'.</p>
                `
            },
            {
                id: "GLC-002",
                title: "Aletsch Glacier",
                category: "glacier",
                status: "Endangered",
                price: 279,
                image: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
                description: "The largest glacier in the Alps, facing significant retreat. Our model preserves its grandeur for future generations with exceptional detail of its medial moraines and ice falls.",
                specs: {
                    scale: "1:1200",
                    latitude: "46.5°N",
                    longitude: "8.0°E",
                    dimensions: "18 × 14 × 10 cm",
                    materials: "Bio-resin, Mineral Pigments",
                    lighting: "Integrated LED (Cool White)",
                    weight: "520g"
                },
                cultural: `
                    <h4>Cultural Significance</h4>
                    <p>The Aletsch Glacier has been a defining feature of the Swiss Alps for millennia. It was first mentioned in historical records in the 11th century and has long served as both a barrier and passageway between mountain communities.</p>
                    
                    <h4>Local Traditions</h4>
                    <p>For centuries, local farmers have used the glacier's meltwater for irrigation. The annual measuring of the glacier's retreat has become a solemn tradition, with records kept since 1892. The nearby Aletsch Forest, a UNESCO World Heritage site, contains some of Europe's oldest stone pines.</p>
                    
                    <h4>Modern Importance</h4>
                    <p>As the largest glacier in the Alps, Aletsch serves as a crucial indicator of climate change in Europe. It's a popular destination for glacier trekking and scientific research, drawing visitors from around the world to witness its majestic scale.</p>
                `
            },
            {
                id: "MTN-001",
                title: "Vinicunca Mountain",
                category: "mountain",
                status: "Stable",
                price: 199,
                image: "https://images.unsplash.com/photo-1551524165-23c6d13f26b1?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
                description: "Peru's Rainbow Mountain, known for its striking mineral-striped appearance. A geological wonder preserved in miniature with accurate color representation of its unique mineral deposits.",
                specs: {
                    scale: "1:1000",
                    latitude: "13.9°S",
                    longitude: "71.3°W",
                    dimensions: "12 × 10 × 6 cm",
                    materials: "Bio-resin, Mineral Pigments",
                    lighting: "None",
                    weight: "380g"
                },
                cultural: `
                    <h4>Cultural Significance</h4>
                    <p>Vinicunca, known locally as Montaña de Siete Colores (Mountain of Seven Colors), has been sacred to Andean communities for centuries. It was only recently revealed due to glacial retreat, making it accessible to the wider world.</p>
                    
                    <h4>Local Traditions</h4>
                    <p>Local Quechua people believe the mountain is a gift from Pachamama (Mother Earth) and the Apus (mountain spirits). Traditional ceremonies are still performed at its base, asking for protection and blessings. The colorful stripes are said to represent different aspects of Andean cosmology.</p>
                    
                    <h4>Modern Importance</h4>
                    <p>Since its discovery by tourists around 2015, Vinicunca has become one of Peru's most visited natural attractions after Machu Picchu. Its popularity has brought economic opportunity to local communities while raising concerns about sustainable tourism.</p>
                `
            },
            {
                id: "VOL-001",
                title: "Mount Fuji",
                category: "volcano",
                status: "Active",
                price: 229,
                image: "https://images.unsplash.com/photo-1505852679233-d9fd70aff56d?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
                description: "Japan's iconic stratovolcano, captured in its perfect symmetrical form. This archive includes subtle details of its volcanic geology and seasonal snow cap variations.",
                specs: {
                    scale: "1:1500",
                    latitude: "35.4°N",
                    longitude: "138.7°E",
                    dimensions: "14 × 14 × 12 cm",
                    materials: "Bio-resin, Mineral Pigments",
                    lighting: "None",
                    weight: "420g"
                },
                cultural: `
                    <h4>Cultural Significance</h4>
                    <p>Mount Fuji is Japan's most iconic symbol and has been worshipped as a sacred mountain for over a thousand years. It was added to the UNESCO World Heritage List in 2013 as a cultural site, recognized for its profound influence on Japanese art and culture.</p>
                    
                    <h4>Local Traditions</h4>
                    <p>Fuji has been a pilgrimage site for centuries, with the Fujiko sect considering it a sacred being. The climbing season (July-August) sees thousands of pilgrims and tourists ascend to the summit, often overnight to witness the sunrise (Goraikō). Traditional woodblock prints by artists like Hokusai have immortalized Fuji's form.</p>
                    
                    <h4>Modern Importance</h4>
                    <p>Today, Mount Fuji remains an active volcano (last eruption 1707) and is carefully monitored. It continues to inspire artists, photographers, and visitors from around the world, symbolizing both Japan's natural beauty and cultural heritage.</p>
                `
            },
            {
                id: "DSR-001",
                title: "Sahara Dunes",
                category: "desert",
                status: "Expanding",
                price: 179,
                image: "https://images.unsplash.com/photo-1418065460487-3e41a6c84dc5?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
                description: "The ever-shifting sand dunes of the Sahara Desert, frozen in time. This archive captures the intricate patterns formed by wind and the play of light on sand.",
                specs: {
                    scale: "1:800",
                    latitude: "25.0°N",
                    longitude: "12.0°E",
                    dimensions: "16 × 10 × 4 cm",
                    materials: "Bio-resin, Sand Composite",
                    lighting: "None",
                    weight: "350g"
                },
                cultural: `
                    <h4>Cultural Significance</h4>
                    <p>The Sahara has been home to nomadic tribes like the Tuareg for millennia, who have developed unique cultures adapted to the harsh desert environment. Ancient trade routes crossed these dunes, connecting sub-Saharan Africa with the Mediterranean world.</p>
                    
                    <h4>Local Traditions</h4>
                    <p>Traditional navigation techniques using stars, wind patterns, and dune formations have been passed down through generations. The Tuareg are known as the 'Blue People' for their distinctive indigo-dyed clothing, which protects them from the sun and symbolizes their identity.</p>
                    
                    <h4>Modern Importance</h4>
                    <p>The Sahara is expanding due to climate change and desertification, threatening bordering ecosystems and communities. However, it also holds potential for solar energy generation and continues to be an important area for geological and climate research.</p>
                `
            },
            {
                id: "OCN-001",
                title: "Great Barrier Reef",
                category: "ocean",
                status: "Critically Endangered",
                price: 299,
                image: "https://images.unsplash.com/photo-1544551763-46a013bb70d5?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
                description: "A section of the world's largest coral reef system, showcasing its vibrant biodiversity. This archive highlights the delicate coral structures that are threatened by ocean warming.",
                specs: {
                    scale: "1:500",
                    latitude: "18.3°S",
                    longitude: "147.7°E",
                    dimensions: "20 × 15 × 8 cm",
                    materials: "Bio-resin, Mineral Pigments",
                    lighting: "Integrated LED (Blue)",
                    weight: "580g"
                },
                cultural: `
                    <h4>Cultural Significance</h4>
                    <p>The Great Barrier Reef has been integral to Aboriginal Australian and Torres Strait Islander cultures for over 60,000 years. It features prominently in Dreamtime stories and is central to the cultural identity of more than 70 Traditional Owner groups.</p>
                    
                    <h4>Local Traditions</h4>
                    <p>Traditional Owners have maintained sustainable relationships with the reef for millennia, with knowledge of tidal patterns, marine life behaviors, and seasonal changes passed down through generations. Ceremonies and stories connected to the reef reinforce cultural laws and environmental stewardship.</p>
                    
                    <h4>Modern Importance</h4>
                    <p>As the world's largest coral reef ecosystem, it supports an incredible diversity of marine life and provides economic benefits through tourism and fisheries. However, it faces severe threats from climate change, with mass coral bleaching events becoming increasingly common.</p>
                `
            }
        ];

        // Shopping cart
        let cart = [];
        let currentProduct = null;
        let currentFilter = "all";
        let currentSearch = "";

        // DOM elements
        const archiveGrid = document.getElementById('archiveGrid');
        const cartIcon = document.getElementById('cartIcon');
        const cartSidebar = document.getElementById('cartSidebar');
        const closeCart = document.getElementById('closeCart');
        const cartItems = document.getElementById('cartItems');
        const cartTotal = document.getElementById('cartTotal');
        const checkoutBtn = document.getElementById('checkoutBtn');
        const productModal = document.getElementById('productModal');
        const closeModal = document.getElementById('closeModal');
        const closeModalBtn = document.getElementById('closeModalBtn');
        const overlay = document.getElementById('overlay');
        const modalImage = document.getElementById('modalImage');
        const modalTitle = document.getElementById('modalTitle');
        const modalId = document.getElementById('modalId');
        const modalPrice = document.getElementById('modalPrice');
        const modalDescription = document.getElementById('modalDescription');
        const modalSpecs = document.getElementById('modalSpecs');
        const modalAddToCart = document.getElementById('modalAddToCart');
        const archiveSearch = document.getElementById('archiveSearch');
        const filterButtons = document.querySelectorAll('.filter-btn');
        const culturalInfo = document.getElementById('culturalInfo');
        const modalTabs = document.querySelectorAll('.modal-tab');
        const tabContents = document.querySelectorAll('.tab-content');

        // Initialize the page
        function init() {
            renderProducts();
            updateCartCount();
            setupEventListeners();
        }

        // Render products to the grid
        function renderProducts() {
            archiveGrid.innerHTML = '';
            
            const filteredProducts = products.filter(product => {
                const matchesFilter = currentFilter === "all" || product.category === currentFilter;
                const matchesSearch = currentSearch === "" || 
                    product.title.toLowerCase().includes(currentSearch.toLowerCase()) ||
                    product.id.toLowerCase().includes(currentSearch.toLowerCase()) ||
                    product.description.toLowerCase().includes(currentSearch.toLowerCase());
                
                return matchesFilter && matchesSearch;
            });
            
            if (filteredProducts.length === 0) {
                archiveGrid.innerHTML = `
                    <div style="grid-column: 1/-1; text-align: center; padding: 60px 20px;">
                        <i class="fas fa-search" style="font-size: 3rem; color: #bdc3c7; margin-bottom: 20px;"></i>
                        <h3>No archives found</h3>
                        <p>Try adjusting your search or filter criteria</p>
                    </div>
                `;
                return;
            }
            
            filteredProducts.forEach(product => {
                const card = document.createElement('div');
                card.className = 'archive-card';
                card.innerHTML = `
                    <div class="archive-image">
                        <img src="${product.image}" alt="${product.title}">
                        <div class="archive-price">$${product.price}</div>
                    </div>
                    <div class="archive-content">
                        <span class="archive-id">${product.id}</span>
                        <h3 class="archive-title">${product.title}</h3>
                        <span class="archive-status">${product.status}</span>
                        <p class="archive-description">${product.description.substring(0, 120)}...</p>
                        <div class="archive-specs">
                            <div class="spec">
                                <div class="spec-value">${product.specs.scale}</div>
                                <div class="spec-label">Scale</div>
                            </div>
                            <div class="spec">
                                <div class="spec-value">${product.specs.latitude}</div>
                                <div class="spec-label">Latitude</div>
                            </div>
                            <div class="spec">
                                <div class="spec-value">${product.specs.longitude}</div>
                                <div class="spec-label">Longitude</div>
                            </div>
                        </div>
                        <div class="archive-actions">
                            <button class="view-details" data-id="${product.id}">View Details</button>
                            <button class="add-to-cart" data-id="${product.id}">
                                <i class="fas fa-shopping-cart"></i> Add to Cart
                            </button>
                        </div>
                    </div>
                `;
                archiveGrid.appendChild(card);
            });

            // Add visibility animation after a short delay
            setTimeout(() => {
                document.querySelectorAll('.archive-card').forEach((card, index) => {
                    setTimeout(() => {
                        card.classList.add('visible');
                    }, index * 150);
                });
            }, 300);
        }

        // Setup event listeners
        function setupEventListeners() {
            // Cart toggle
            cartIcon.addEventListener('click', toggleCart);
            closeCart.addEventListener('click', toggleCart);
            
            // Modal
            closeModal.addEventListener('click', closeProductModal);
            closeModalBtn.addEventListener('click', closeProductModal);
            overlay.addEventListener('click', () => {
                closeProductModal();
                toggleCart(false);
            });
            
            // Checkout
            checkoutBtn.addEventListener('click', proceedToCheckout);
            
            // Search functionality
            archiveSearch.addEventListener('input', function() {
                currentSearch = this.value;
                renderProducts();
            });
            
            // Filter functionality
            filterButtons.forEach(button => {
                button.addEventListener('click', function() {
                    filterButtons.forEach(btn => btn.classList.remove('active'));
                    this.classList.add('active');
                    currentFilter = this.getAttribute('data-filter');
                    renderProducts();
                });
            });
            
            // Modal tabs
            modalTabs.forEach(tab => {
                tab.addEventListener('click', function() {
                    const tabName = this.getAttribute('data-tab');
                    
                    modalTabs.forEach(t => t.classList.remove('active'));
                    this.classList.add('active');
                    
                    tabContents.forEach(content => {
                        content.classList.remove('active');
                        if (content.id === `${tabName}Tab`) {
                            content.classList.add('active');
                        }
                    });
                });
            });
            
            // View details and add to cart (delegated events)
            document.addEventListener('click', function(e) {
                // View details
                if (e.target.classList.contains('view-details') || e.target.parentElement.classList.contains('view-details')) {
                    const button = e.target.classList.contains('view-details') ? e.target : e.target.parentElement;
                    const productId = button.getAttribute('data-id');
                    openProductModal(productId);
                }
                
                // Add to cart from product card
                if (e.target.classList.contains('add-to-cart') || e.target.parentElement.classList.contains('add-to-cart')) {
                    const button = e.target.classList.contains('add-to-cart') ? e.target : e.target.parentElement;
                    const productId = button.getAttribute('data-id');
                    addToCart(productId);
                    
                    // Visual feedback
                    button.innerHTML = '<i class="fas fa-check"></i> Added to Cart';
                    button.classList.add('added');
                    setTimeout(() => {
                        button.innerHTML = '<i class="fas fa-shopping-cart"></i> Add to Cart';
                        button.classList.remove('added');
                    }, 2000);
                }
            });
            
            // Add to cart from modal
            modalAddToCart.addEventListener('click', function() {
                if (currentProduct) {
                    addToCart(currentProduct.id);
                    closeProductModal();
                }
            });
            
            // Header scroll effect
            window.addEventListener('scroll', function() {
                const header = document.getElementById('header');
                if (window.scrollY > 50) {
                    header.classList.add('scrolled');
                } else {
                    header.classList.remove('scrolled');
                }
            });
            
            // Scroll animation for elements
            window.addEventListener('scroll', checkVisibility);
            checkVisibility(); // Initial check
            
            // Form submission
            document.querySelector('.email-form').addEventListener('submit', function(e) {
                e.preventDefault();
                const email = this.querySelector('.email-input').value;
                alert(`Thank you! We've added ${email} to our waitlist. You'll be the first to know when new archives are available.`);
                this.querySelector('.email-input').value = '';
            });
        }

        // Toggle cart sidebar
        function toggleCart(forceState) {
            if (forceState !== undefined) {
                if (forceState) {
                    cartSidebar.classList.add('active');
                    overlay.classList.add('active');
                } else {
                    cartSidebar.classList.remove('active');
                    overlay.classList.remove('active');
                }
            } else {
                cartSidebar.classList.toggle('active');
                overlay.classList.toggle('active');
            }
            
            if (cartSidebar.classList.contains('active')) {
                renderCartItems();
            }
        }

        // Open product modal
        function openProductModal(productId) {
            currentProduct = products.find(p => p.id === productId);
            if (!currentProduct) return;
            
            modalImage.querySelector('img').src = currentProduct.image;
            modalTitle.textContent = currentProduct.title;
            modalId.textContent = currentProduct.id;
            modalPrice.textContent = `$${currentProduct.price}`;
            modalDescription.textContent = currentProduct.description;
            culturalInfo.innerHTML = currentProduct.cultural;
            
            // Reset tabs to details
            modalTabs.forEach(tab => tab.classList.remove('active'));
            tabContents.forEach(content => content.classList.remove('active'));
            document.querySelector('.modal-tab[data-tab="details"]').classList.add('active');
            document.getElementById('detailsTab').classList.add('active');
            
            // Render specs
            modalSpecs.innerHTML = '';
            for (const [key, value] of Object.entries(currentProduct.specs)) {
                const specItem = document.createElement('div');
                specItem.className = 'spec-item';
                specItem.innerHTML = `
                    <div class="spec-label">${key.charAt(0).toUpperCase() + key.slice(1)}</div>
                    <div class="spec-value">${value}</div>
                `;
                modalSpecs.appendChild(specItem);
            }
            
            productModal.classList.add('active');
            overlay.classList.add('active');
        }

        // Close product modal
        function closeProductModal() {
            productModal.classList.remove('active');
            overlay.classList.remove('active');
            currentProduct = null;
        }

        // Add product to cart
        function addToCart(productId) {
            const product = products.find(p => p.id === productId);
            if (!product) return;
            
            const existingItem = cart.find(item => item.id === productId);
            if (existingItem) {
                existingItem.quantity += 1;
            } else {
                cart.push({
                    id: product.id,
                    title: product.title,
                    price: product.price,
                    image: product.image,
                    quantity: 1
                });
            }
            
            updateCartCount();
            
            // If cart is open, update it
            if (cartSidebar.classList.contains('active')) {
                renderCartItems();
            }
        }

        // Remove item from cart
        function removeFromCart(productId) {
            cart = cart.filter(item => item.id !== productId);
            updateCartCount();
            renderCartItems();
        }

        // Update item quantity in cart
        function updateQuantity(productId, newQuantity) {
            if (newQuantity < 1) {
                removeFromCart(productId);
                return;
            }
            
            const item = cart.find(item => item.id === productId);
            if (item) {
                item.quantity = newQuantity;
                renderCartItems();
                updateCartCount();
            }
        }

        // Update cart count in header
        function updateCartCount() {
            const count = cart.reduce((total, item) => total + item.quantity, 0);
            document.querySelector('.cart-count').textContent = count;
        }

        // Render cart items
        function renderCartItems() {
            if (cart.length === 0) {
                cartItems.innerHTML = `
                    <div class="empty-cart">
                        <i class="fas fa-box-open"></i>
                        <p>Your collection is empty</p>
                        <p>Explore our archives to add items</p>
                    </div>
                `;
                cartTotal.textContent = '$0.00';
                return;
            }
            
            cartItems.innerHTML = '';
            let total = 0;
            
            cart.forEach(item => {
                const itemTotal = item.price * item.quantity;
                total += itemTotal;
                
                const cartItem = document.createElement('div');
                cartItem.className = 'cart-item';
                cartItem.innerHTML = `
                    <div class="cart-item-image">
                        <img src="${item.image}" alt="${item.title}">
                    </div>
                    <div class="cart-item-details">
                        <div class="cart-item-title">${item.title}</div>
                        <div class="cart-item-id">${item.id}</div>
                        <div class="cart-item-price">$${item.price}</div>
                        <div class="cart-item-quantity">
                            <button class="quantity-btn decrease" data-id="${item.id}">-</button>
                            <input type="number" class="quantity-input" value="${item.quantity}" min="1" data-id="${item.id}">
                            <button class="quantity-btn increase" data-id="${item.id}">+</button>
                            <button class="remove-item" data-id="${item.id}">Remove</button>
                        </div>
                    </div>
                `;
                cartItems.appendChild(cartItem);
            });
            
            cartTotal.textContent = `$${total.toFixed(2)}`;
            
            // Add event listeners to cart items
            document.querySelectorAll('.decrease').forEach(btn => {
                btn.addEventListener('click', function() {
                    const productId = this.getAttribute('data-id');
                    const item = cart.find(item => item.id === productId);
                    if (item) {
                        updateQuantity(productId, item.quantity - 1);
                    }
                });
            });
            
            document.querySelectorAll('.increase').forEach(btn => {
                btn.addEventListener('click', function() {
                    const productId = this.getAttribute('data-id');
                    const item = cart.find(item => item.id === productId);
                    if (item) {
                        updateQuantity(productId, item.quantity + 1);
                    }
                });
            });
            
            document.querySelectorAll('.quantity-input').forEach(input => {
                input.addEventListener('change', function() {
                    const productId = this.getAttribute('data-id');
                    updateQuantity(productId, parseInt(this.value) || 1);
                });
            });
            
            document.querySelectorAll('.remove-item').forEach(btn => {
                btn.addEventListener('click', function() {
                    const productId = this.getAttribute('data-id');
                    removeFromCart(productId);
                });
            });
        }

        // Proceed to checkout
        function proceedToCheckout() {
            if (cart.length === 0) {
                alert('Your cart is empty. Please add some archives to your collection before checkout.');
                return;
            }
            
            // In a real application, this would redirect to a checkout page
            alert(`Thank you for your order! You're purchasing ${cart.reduce((total, item) => total + item.quantity, 0)} archive(s) for a total of ${cartTotal.textContent}. This is a demo, so no actual purchase will be made.`);
            
            // Clear cart after "purchase"
            cart = [];
            updateCartCount();
            renderCartItems();
            toggleCart(false);
        }

        // Scroll animation for elements
        function checkVisibility() {
            const elements = document.querySelectorAll('.archive-card, .process-step');
            
            elements.forEach(element => {
                const elementTop = element.getBoundingClientRect().top;
                const elementVisible = 150;
                
                if (elementTop < window.innerHeight - elementVisible) {
                    element.classList.add('visible');
                }
            });
        }

        // Initialize the application
        init();
    </script>
</body>
</html>